<template>
  <el-dialog
    title="教练数据汇总"
    :visible.sync="visible"
    width="50%"
  >
    <!-- 外层容器，控制高度和滚动 -->
    <div style="max-height: 300px; overflow-y: auto;">
      <el-table :data="result" border stripe style="width: 100%;">
        <el-table-column prop="coachAccount" label="教练账号" align="center"/>
        <el-table-column prop="coachName" label="教练姓名" align="center"/>
        <el-table-column prop="userNames" label="学员名单" align="center"/>
      </el-table>
    </div>

    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: 'ResultDialog',
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    result: {
      type: Array,
      default: () => []
    }
  }
}
</script>
